﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ListCustomerType.ascx.cs" Inherits="PayrollHR.Administration.Modules.ListCustomerType" %>
<%@ Register Src="CustomerTypeSearch.ascx" TagName="CustomerTypeSearch" TagPrefix="uc1" %>
<%@ Register Src="ConfirmationBox.ascx" TagName="ConfirmationBox" TagPrefix="uc2" %>
<script type="text/javascript">
    $(window).bind('load', function () {
        var cbHeader = $(".cbHeader input");
        var cbRowItem = $(".cbRowItem input");
        cbHeader.bind("click", function () {
            cbRowItem.each(function () { this.checked = cbHeader[0].checked; })
        });
        cbRowItem.bind("click", function () { if ($(this).checked == false) cbHeader[0].checked = false; });
    });
</script>
<asp:UpdatePanel ID="upForumSubscriptions" runat="server">
    <ContentTemplate>
        <div class="section-header">
            <div class="title">
                <img src="Common/ico-customers.png" alt="Admin.Customers.ManagerCustomer" />
                <%=GetLocaleResourceString("Admin.ListCustomerType.ManagerCustomerType")%>
            </div>
            <div class="options">
                <asp:HyperLink runat="server" Visible="False" ID="hlexport" ForeColor="#6600CC">[hlexport]</asp:HyperLink>
                <asp:Button ID="SearchButton" runat="server" Text="Filter"
                    CssClass="adminButtonBlue" ToolTip="Filter" OnClick="SearchButton_Click" />
                <asp:Button runat="server" Text="Delete"
                    CssClass="adminButtonBlue" ID="btnDelete" ValidationGroup="ExportXLS"
                    ToolTip="Delete Customer" OnClick="btnDelete_Click" />
                <uc2:ConfirmationBox ID="cbDelete" runat="server" TargetControlID="btnDelete"
                    YesText="<% $PayrollResources:Admin.Common.Yes %>" NoText="<% $PayrollResources:Admin.Common.No %>"
                    ConfirmText="<% $PayrollResources:Admin.Common.AreYouSure %>" />
                <input type="button" onclick="location.href = 'addCustomerType.aspx'" value="<%=GetLocaleResourceString("Admin.Customers.AddNew")%>"
                    id="btnAddNew" class="adminButtonBlue" title="<%=GetLocaleResourceString("Admin.Customers.AddNew")%>" />
            </div>
        </div>
        <div>
            <uc1:CustomerTypeSearch ID="ctrCustomerTypeSearch" runat="server" />
        </div>
        <p>
        </p>
        <asp:GridView ID="gvCustomerType" runat="server" AutoGenerateColumns="False" Width="100%" DataKeyNames="CutomerTypeId"
            PageSize="12">
            <Columns>

                <asp:TemplateField ItemStyle-Width="3%" ItemStyle-HorizontalAlign="Center">
                    <HeaderTemplate>
                        <asp:CheckBox ID="cbSelectAll" runat="server" CssClass="cbHeader" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="cbCustomerInfo" runat="server" CssClass="cbRowItem" ToolTip="<% $PayrollResources:Admin.Customers.CustName.ToolTip %>" />
                        <asp:HiddenField ID="hfCustomerID" runat="server" Value='<%# Eval("CutomerTypeId") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Loại Khách Hàng" ItemStyle-Width="20%">
                    <ItemTemplate>
                        <%#Server.HtmlEncode(Eval("CutomerTypeName").ToString())%>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Ký tự bắt đầu" ItemStyle-Width="20%">
                    <ItemTemplate>
                        <%# Server.HtmlEncode(Eval("pre").ToString()) %>                        
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Số cuối thẻ khách hàng" ItemStyle-Width="20%">
                    <ItemTemplate>
                        <%# Server.HtmlEncode(Eval("LastId").ToString()) %>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </ContentTemplate>
</asp:UpdatePanel>

